#include <iostream>
#include <cstring>
using namespace std;

class Student {
private:
    char Name[50];
    char* Num;
    int Math, English, Physics, Cpp;
public:
    Student(char* Name = NULL, char* Num = NULL,
        int Math = 0, int English = 0,
        int Physics = 0, int Cpp = 0) {
        if (Name) strcpy(this->Name, Name);
        if (Num) {
            this->Num = new char[strlen(Num) + 1];
            strcpy(this->Num, Num);
        }
        else this->Num = NULL;

        this->Math = Math;
        this->English = English;
        this->Physics = Physics;
        this->Cpp = Cpp;
    }
    Student(const Student& other) {
        strcpy(Name, other.Name);
        Num = new char[strlen(other.Num) + 1];
        strcpy(Num, other.Num);
        Math = other.Math;
        English = other.English;
        Physics = other.Physics;
        Cpp = other.Cpp;
    }
    ~Student() { if (Num) delete[] Num; }

    void setNameNo(char* name, char* no) {
        strcpy(Name, name);
        if (Num) delete[] Num;
        Num = new char[strlen(no) + 1];
        strcpy(Num, no);
    }
    void outputInfo() {
        cout << "Name: " << Name << ", Num: " << Num << endl;
        cout << "Scores: " << Math << " " << English
            << " " << Physics << " " << Cpp << endl;
    }
};

int main() {
    Student stu1((char*)"LiSi", (char*)"20250002", 88, 90, 86, 95);
    Student stu2 = stu1;

    stu1.outputInfo();
    stu2.outputInfo();
    return 0;
}